// 这是文章分类的路由模块

const express = require("express")
const { expressjwt } = require("express-jwt")
    // 创建路由对象
const router = express.Router()
    // 导入文章分类的路由处理函数
const artcate_handler = require('../router_handler/artcate')
    // 导入验证规则
const { addCates_schema, deleteCates_schema } = require('../schema/artcate')
const expressJoi = require('@escook/express-joi')


router.get('/cates', artcate_handler.getCates)
    // 新增文章分类的接口
router.post('/addcates', expressJoi(addCates_schema), artcate_handler.addCates)
    // 删除分类的接口
router.get('/deletecate/:id', expressJoi(deleteCates_schema), artcate_handler.deleteCateByid)

module.exports = router